<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <title>盛筑OA协同办公系统</title>
    <link rel="stylesheet" href="./static/lib/fontawesome/css/font-awesome.min.css" />
    <link rel="stylesheet" href="./static/lib/layui/css/layui.css">
    <link rel="stylesheet" href="./static/kaige/css/index.css?s=6162" />
</head>

<body class="skin-blue">
    <div class="loading-index">盛筑智能办公系统 > 加载中...</div>
    <header class="main-header layui-hide">
        <a href="javascript:;" class="logo">
            <span class="logo-mini" title="盛筑OA协同办公系统">盛筑</span>
            <span class="logo-lg">盛筑OA协同办公系统</span>
        </a>
        <a href="#" class="sidebar-toggle sideico-t2" title="切换导航">
            <span class="sr-only">切换导航</span>
        </a>
        <div class="navtab">
            <div class="task-tab-btn overleftbtn"><i class="layui-icon layui-icon-left"></i></div>
            <div class="taskbox">
                <ul class="ml-taskbar-task"></ul>
            </div>
            <div class="task-tab-btn overrightbtn"><i class="layui-icon layui-icon-right"></i></div>
            <div class="task-tab-btn overmorebtn" id="overmorebtn"><i class="layui-icon layui-icon-more-vertical"></i></div>
        </div>
        <div class="user-info-box">
            <ul class="user-info-content">
                <li>
                    <a href="#" class="user-info-toggle">
                        <img src="" class="user-avatar" alt="用户头像">
                    </a>
                    <ul class="user-info-menu">
                        <li class="user-header">
                            <img src="" class="img-circle" alt="用户头像">
                            <p>
                                <span>昵称</span><small>恺哥</small>
                                <span>登录次数</span><small>251</small>
                                <span>上次IP</span><small>117.26.0.36</small>
                                <span>上次登录</span><small>2022-06-13 11:34</small>
                            </p>
                        </li>
                        <li class="user-footer">
                            <div class="pull-left">
                                <a id="edit-pass" class="btn btn-default btn-flat">修改密码</a>
                            </div>
                            <div class="pull-right">
                                <a id="logout" class="btn btn-default btn-flat">退出系统</a>
                            </div>
                        </li>
                    </ul>
                </li>
                <li>
                    <a href="javascript:;" class="btn-fullscreen" title="全屏模式切换"><i class="fa fa-expand"></i></a>
                </li>
            </ul>
        </div>
    </header>

    <aside class="main-sidebar layui-hide">
        <div class="navmenu">
            <ul class="nm-ul" id="nav_left_menu"></ul>
        </div>
        <section class="ml-m-r">
            <div class="layui-side-scroll">
                <ul class="ml-menu layui-nav layui-nav-tree"></ul>
            </div>
        </section>
    </aside>

    <div class="content-wrapper layui-hide"></div>

    <footer class="main-footer layui-hide">
        <div class="pull-right hidden-xs"><b>版本</b>&nbsp;v1.0.0</div>©2022&nbsp;泉州市盛筑信息科技有限公司&nbsp;版权所有
    </footer>
    <div class="szmpwin" id="szmpwin"><i class="layui-icon layui-icon-cellphone"></i></div>
    <script src="./static/lib/jquery/jquery.min.js"></script>
    <script src="./static/kaige/js/qs.js"></script>
    <script src="./static/kaige/js/cry/md5.js"></script>
    <script src="./static/kaige/js/cry/sha1.js"></script>
    <script src="./static/kaige/js/szoa.js"></script>
    <script src="./static/lib/layui/layui.js"></script>
    <script src="./static/kaige/js/szmpwin.js"></script>
    <script>
        layui.config({
            base: './static/kaige/layuiextend/'
        }).use(['element', 'layer', 'kaigehome', 'oawin', 'oamenu'], function () {
            var element = layui.element, $ = layui.jquery, layer = layui.layer, kaigehome = layui.kaigehome, oawin = layui.oawin, oamenu = layui.oamenu;
            window.load_add = function () {
                $dom = '<div class="layui-progress" lay-filter="index-loading" lay-showPercent="yes"><div class="layui-progress-bar" lay-percent="0%"></div></div>';
                $('body').append($dom);
                var starnum = 0;
                var load_it = setInterval(function () {
                    starnum += 1;
                    element.progress('index-loading', starnum + '%');
                    if (starnum >= 99) {
                        clearInterval(load_it);
                    } else if (starnum < 80) {
                        starnum += 10;
                    }
                }, 10);
            }
            window.load_del = function () { $('.layui-progress').remove() };

            window.kaige_page = {
                logout_url: '/index/logout',
                welcome: './pages/welcome.html',
                menus: [],
                leftmenu: [],
            };
            //取数据
            szoa.ajax({
                url: '/index/index',
                type: 'GET',
                async: false,
                success: function (result) {
                    if (result.status) {
                        console.log(result);
                        var d = result.data;
                        if (d.title) document.title = d.title;
                        if (d.site_name) {
                            $('.logo').html('<span class="logo-mini" title="' + d.site_name + '">' + (d.site_name.slice(0, 2)) + '</span><span class="logo-lg">' + d.site_name + '</span>');
                        }
                        if (d.app_version && d.site_copy) {
                            $('footer').html('<div class="pull-right hidden-xs"><b>版本</b> ' + d.app_version + '</div>' + d.site_copy + '');
                        }
                        if (typeof (d.menus) == 'string') {
                            d.menus = JSON.parse(d.menus);
                            kaige_page.menus = d.menus;
                            // console.log(d.menus);
                        }
                        if (typeof (d.leftmenu) == 'string') {
                            d.leftmenu = JSON.parse(d.leftmenu);
                            kaige_page.leftmenu = d.leftmenu;
                        }
                        if (typeof (d.config) === 'object') {
                            var uo = $('.user-header');
                            uo.find('img').attr('src', d.config.avatar);
                            $('.user-avatar').attr('src', d.config.avatar);
                            uo.find('p').html('<span>昵称</span><small>' + d.config.nickname + '</small><span>登录次数</span><small>' + d.config.login_num + '</small><span>上次IP</span><small>' + d.config.last_ip + '</small><span>上次登录</span><small>' + d.config.last_time + '</small>');
                        }
                        window.kaige_page.dict = d.dict;
                        // console.log(kaige_page.dict);
                        start();
                    }
                }
            });
            //取完数据再执行
            function start() {
                if (szoa.getToken()) {
                    $('header').removeClass('layui-hide');
                    $('aside').removeClass('layui-hide');
                    $('.content-wrapper').removeClass('layui-hide');
                    $('footer').removeClass('layui-hide');
                    $('.loading-index').remove();
                    oawin.init();
                    oamenu.init();
                    szmpwin();
                } else {
                    window.location.href = './pages/login.html';
                }
            }
        });
    </script>
</body>

</html>